# decoding=utf-8
from os.path import join, dirname, abspath

# 项目的路径
BASE_PATH = abspath(dirname(__file__)).replace("Conf", '')

# 浏览器driver的路径
CHROME_DRIVER_PATH = join(BASE_PATH, "driver", "chromedriver.exe")

NEW_CHROME_DRIVER_PATH = join(BASE_PATH, "driver", "chromedriver1.exe")
# firefox  selenium  driver
FIREFOX_DRIVER_PATH = join(BASE_PATH, "driver", "geckodriver.exe")

# log存储的路径
LOG_SAVE_PATH = join(BASE_PATH, "OutPuts", 'log')

# 失败保存截图的路径
SAVE_SCREENSHOT_PATH = join(BASE_PATH, 'OutPuts', 'image')

# 页面加载时间
CHROME_LOAD_PAGE_TOME = 30

# 脚本执行等待时间
CHROME_SCRIPT_TIME = 30

# CHROME Implicit waiting time
CHROME_IMP = 10

# 项目 前台
PROJECT_URL_HOME_PAGE = r""
# 项目 后台
PROJECT_URL_MANAGER_PAGE = r''

# Fixed role JS code

JS_RIGHt = "var q=document.documentElement.scrollLeft=10000"

JS_LEFT = '"var q=document.documentElement.scrollLeft=0"'

JS_TOP = "var q=document.documentElement.scrollTop=0"

JS_BOTTOM = '"var q=document.documentElement.scrollTop=10000"'

# unittest testcase 执行的文件夹

UNITTEST_TEST_PATH = join(BASE_PATH, "TestCases")

# 报告执行的文件 unittest

UNITTEST_REPORT_PATH = join(BASE_PATH, 'OutPuts', 'report')

# 项目的配置文件 包含 mysql  log  username,password

PROJECT_CONF_SETTING = {
    'project': join(BASE_PATH, 'conf', 'project.ini')
}

# yaml 文件存储的路径

COMMON_FILE = join(BASE_PATH, 'TestDatas')

YAML_FILE_LIST = {
    'al': join(COMMON_FILE, "apply_loan.yaml"),
}

# 页面元素查找的类型不包含就出错
ELEMENT_POS = [
    'id', 'xpath', 'link text', 'partial link text', 'name',
    'tag name', 'class name', 'css selector'
]

# cav文件存储的路径
CSV_FILE_PATH = {
    # "login_info": join(COMMON_FILE, 'Conf', 'login.csv'),
}

# 这些字段在文件读取的时候不管的什么类型的文件都得转换成 int 类型的字段
CONVER_LIST = ["port", "minsize", 'maxsize', 'backupcount', 'maxbytes']

# 分布式机器
DISTRIBUTED_MACHINE = {
    "http://XXX:XXXX/wd/hub", 'Chrome',
    "http://XXX:XXXX/wd/hub", 'Firefox',
    "http://XXX:XXXX/wd/hub", 'Chrome',
}

# 测试套件1
SUIT_1 = []

# 测试套件2
SUIT_2 = []



